package com.cavy.platform.server.dto;

import com.cavy.platform.server.validator.FormatValidatorGroup;
import com.cavy.platform.server.validator.GitUrl;
import com.cavy.platform.server.validator.LastValidatorGroup;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;

import static com.cavy.platform.server.domain.GitRemotePipeline.DEFAULT_BRANCH;

/**
 * @author 唐旭
 * @Date 2018/7/23
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
public class GitRemotePipelineCreateDto extends PipelineCreateDto {
    @NotNull(message = "仓库地址不能为空", groups = FormatValidatorGroup.class)
    @GitUrl(groups = LastValidatorGroup.class)
    private String url;
    private String branch = DEFAULT_BRANCH;
    private String username;
    private String password;
    @NotNull(message = "文件路径不能为空")
    private String filePath;
}
